package com.lijiajian.controller;

import com.lijiajian.Service.CustomerReprieveService;
import com.lijiajian.base.BaseController;
import com.lijiajian.base.ResultInfo;
import com.lijiajian.pojo.CustomerReprieve;
import com.lijiajian.query.CustomerReprieveQuery;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("customerReprieve")
public class CustomerReprieveController extends BaseController {
    @Resource
    private CustomerReprieveService customerReprieveService;

    /**
     * 查询暂缓表
     * @param customerReprieveQuery
     * @return
     */
    @GetMapping("customerReprieveList")
    @ResponseBody
    public Map<String,Object> queryCustomerReprieve(CustomerReprieveQuery customerReprieveQuery){
        return customerReprieveService.queryCustomerReprieve(customerReprieveQuery);
    }

    /**
     * 添加暂缓数据
     * @return
     */
    @PostMapping("add")
    @ResponseBody
    public ResultInfo addCustomerReprieve(CustomerReprieve customerReprieve){
        customerReprieveService.addCustomerReprieve(customerReprieve);
        return success("添加成功");
    }

    /**
     * 修改暂缓数据
     * @return
     */
    @PostMapping("update")
    @ResponseBody
    public ResultInfo updateCustomerReprieve(CustomerReprieve customerReprieve){
        customerReprieveService.updateCustomerReprieve(customerReprieve);
        return success("修改成功");
    }

    @PostMapping("delete")
    @ResponseBody
    public ResultInfo deleteCustomerReprieve(Integer[] ids){
        customerReprieveService.deleteCustomerReprieve(ids);
        return success("删除成功");
    }


}
